﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demoforfunction
{
    /// <summary>
    /// 函数演示
    /// </summary>
    class Program
    {
        static void Main(string[] args)
        {
            //调用函数
            for (int i = 0; i < 10; i++)
            {
                ShowMessage($"This is No{i}");
                ShowMessage(i.ToString());
            }
            MyAdd(3, 4);
            Console.WriteLine(MyAdd(3, 4));
            

            Console.ReadKey();
        }
         /// <summary>
         /// 输出一行信息
         /// </summary>
         /// <param name="message">显示的信息</param>
        
         //静态函数,message是形式参数
        
        static void ShowMessage(string message)
        {
            Console.WriteLine(message);
        }
       //返回值
        static int MyAdd(int number1, int number2)
        {
            
            if (number1>number2)
            {
                return number1;
            }
            return number2;
        }

    }
}
